<template>
  <div class="feedbackBox">
    <div>
      <h3>反馈意见</h3>
      <van-form @submit="onSubmit">
        <van-field
          v-model="info.titleVal"
          name="title"
          label="标题"
          placeholder="标题"
        />
        <van-field
          v-model="info.contentVal"
          name="content"
          label="内容"
          placeholder="内容"
        />
        <div style="margin: 16px">
          <van-button round block type="info" native-type="submit"
            >提交</van-button
          >
        </div>
      </van-form>
    </div>
  </div>
</template>

<script>
import { addOpinion } from "@/service/mineService";
export default {
  data() {
    return {
      list: [],
      info: {
        titleVal: "",
        contentVal: "",
      },
    };
  },
  methods: {
    //新增意见
    async onSubmit(values) {
      const { data } = await addOpinion(values);
      if (data.code !== 200) {
        return this.$toast(data.msg);
      } else {
        return this.$toast("反馈成功");
      }
    },
    //查询意见
    // async getAllorderList() {
    //   const { data } = await getFeedback();
    //   if (data.code !== 200) return this.$toast(data.msg);
    //   this.list = data.rows;
    // },
  },
};
</script>

<style lang="scss" scoped>
.feedbackBox {
  width: 300px;
  height: 400px;
  background: #fff;
  color: #333;
  .van-form {
    margin-top: 80px;
  }
  h3 {
    height: 30px;
    margin-top: 30px;
    line-height: 30px;
    text-align: center;
    font-size: 26px;
    color: #333;
    font-weight: 800;
  }
}
</style>
